/******************************************************************************
* This file is part of is32p218 platform,
* Copyright (c) 2009 HangZhou InfoStrong CO.,LTD. All rights reserved.
* This software may only be used under the terms of a valid, current,
* end user license from InfoStrong.
* Nothing else gives you the right to use this software.   
*
* Name:   sys_log.h
* Desc:   System log header file
* Author: Jerry
* Date:   2009-11-16
* Note:   
* History:
*
******************************************************************************/
#include "def.h"

#ifndef __SYS_LOG_H__
#define __SYS_LOG_H__

#ifdef __cplusplus
extern "C" {
#endif

#define LOG_MEM_SIZE 128


// ----------System log definitions(0x01~0x1F)----------
#define LOG_SYS_ASSERT_FILE			0x01
#define LOG_SYS_ASSERT_LINE			0x02
#define LOG_SYS_START				0x03
#define LOG_SYS_OS_START			0x04
#define LOG_SYS_IDLE				0x05
#define LOG_SYS_BLD_TIME			0x06
#define LOG_SYS_OS_STACK_OV			0x07
#define LOG_SYS_OS_MEM_EMPTY		0x08
#define LOG_SYS_SW_VER				0x09
#define LOG_SYS_MEM_MLC_ERR			0x0A
#define LOG_SYS_MEM_FRE_ERR			0x0B

// ----------Driver log definitions(0x20~0x3F)----------
#define LOG_DRV_IFLASH_WRITE		0x20
#define LOG_DRV_IFLASH_ERASE		0x21


// ----------Midware log definitions(0x40~5F)-----------
#define LOG_MW_NRAM_INIT			0x40
#define LOG_MW_NRAM_FORMAT			0x41
#define LOG_MW_NRAM_CRC_ER			0x42
#define LOG_MW_NRAM_WR				0x43
#define LOG_MW_NRAM_CLEANUP			0x44
#define LOG_MW_NRAM_DEL				0x45
#define LOG_MW_NRAM_CHK				0x46
#define LOG_MW_RST_INIT				0x47
#define LOG_MW_RST_READ				0x48
#define LOG_MW_RST_WRITE			0x49

// ----------Application log definitions(0x60~0x9F)-----
#define LOG_APP_AFN_MAC_REQ_TMOUT	0x60
#define LOG_APP_AFN_MAC_REQ_OK		0x61
#define LOG_APP_AFN_EVENT_PIN_HIGH	0x62
#define LOG_APP_AFN_EVENT_PIN_LOW	0x63
// ----------Applicaton IOT --------------------------
#define LOG_APP_IOT_EVENT_RAISE		0x70
#define LOG_APP_IOT_EVENT_CLR		0x71
#define LOG_APP_IOT_TASK_START		0x72
#define LOG_APP_IOT_TASK_END		0x73
#define LOG_APP_IOT_TASK_SCAN_DOWN	0x74


#define LOG_PLC_BIND_START				0x80
#define LOG_PLC_BIND_CLR				0x81
#define LOG_PLC_BIND_T1_RESET			0x82
#define LOG_PLC_BIND_T1_TMOUT			0x83
#define LOG_PLC_BIND_KEEP				0x84
#define LOG_PLC_BIND_CMD				0x85
#define LOG_PLC_BIND_REQ_SND			0x86
#define LOG_PLC_BIND_REQ_REC			0x87
#define LOG_PLC_BIND_S_INFO_RSP_SND		0x88
#define LOG_PLC_BIND_S_INFO_RSP_REC		0x89
#define LOG_PLC_BIND_CFM_SND			0x8A
#define LOG_PLC_BIND_CFM_REC			0x8B
#define LOG_PLC_BIND_T2_RESET			0x8C
#define LOG_PLC_BIND_T2_TMOUT			0x8D
#define LOG_PLC_BIND_S_INFO_RSP_MONI	0x8E
#define LOG_PLC_BIND_CFM_MONI			0x8F
#define LOG_PLC_BIND_SLOT_TM_RESET		0x90
#define LOG_PLC_BIND_SLOT_TM_TMOUT		0x91
#define LOG_PLC_BIND_S_INFO_RSP_TM_RESET	0x92
#define LOG_PLC_BIND_S_INFO_RSP_TM_TMOUT	0x93
#define LOG_PLC_BIND_OK					0x94
#define LOG_PLC_BIND_END				0x95
#define LOG_PLC_BIND_LOCAL_MAC			0x96
#define LOG_PLC_BIND_LOCAL_ANALYSE		0x97
#define LOG_PLC_BIND_MONI_ANALYSE		0x98
#define LOG_PLC_EVENT_REG_ENA			0x99
#define LOG_PLC_EVENT_REPORT			0x9A
#define LOG_PLC_EVENT_REPORT_ACK		0x9B
#define LOG_PLC_BIND_S_INFO_CFM			0x9C
#define LOG_PLC_BIND_S_INFO_CFM_MONI	0x9D
#define LOG_PLC_BIND_ROUND_DC			0x9E
#define LOG_PLC_BIND_BOUND_LIST			0x9F

// ----------PLC log definitions(0xA0~0xFF)----------
#define LOG_PLC_IF_REC				0xA0
#define LOG_PLC_IF_ERROR			0xA1
#define LOG_PLC_IF_TMOUT			0xA2
#define LOG_PLC_IF_SEND				0xA3
#define LOG_PLC_IF_RSSI				0xA4
#define LOG_PLC_IF_CSMA_SEND		0xA5
#define LOG_PLC_IF_CSMA_BO			0xA6
#define LOG_PLC_IF_SEND_HOT_RESET		0xA7
#define LOG_PLC_IF_SEND_WORK			0xA8
#define LOG_PLC_IF_SEND_RAND			0xA9

#define LOG_PLC_DL_FRM_IND			0xAA
#define LOG_PLC_DL_CRC_ERR			0xAB
#define LOG_PLC_DL_PARA_SET			0xAC

#define LOG_PLC_HL_TM_STA			0xB0
#define LOG_PLC_HL_TM_OUT			0xB1
#define LOG_PLC_HL_TM_STP			0xB2
#define LOG_PLC_HL_STATE			0xB3
#define LOG_PLC_HL_DEBUG			0xB4

#define LOG_PLC_NODE_INIT				0xC0
//--------BL0942 log definetions------
#if BL_0942_SPIFRAME_DEBUG
#define LOG_BL_0942_SPIFRAME       0xD0
#endif
#define LOG_ID_MAX	255

typedef struct
{
	U8 m_log_id;
	U8 m_data[200];
}LOG_DATA_T;

void sys_utils_log( U8 log_id, void *p_log, S32 log_len );

#ifdef __cplusplus
}
#endif

#endif // End __SYS_LOG_H__
